/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("protobufjs/minimal");

// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});

/**
 * HeadType enum.
 * @exports HeadType
 * @enum {number}
 * @property {number} LOGIN_REQUEST=0 LOGIN_REQUEST value
 * @property {number} LOGIN_RESPONSE=1 LOGIN_RESPONSE value
 * @property {number} LOGOUT_REQUEST=2 LOGOUT_REQUEST value
 * @property {number} LOGOUT_RESPONSE=3 LOGOUT_RESPONSE value
 * @property {number} HEART_BEAT=4 HEART_BEAT value
 * @property {number} MESSAGE_REQUEST=5 MESSAGE_REQUEST value
 * @property {number} MESSAGE_RESPONSE=6 MESSAGE_RESPONSE value
 * @property {number} MESSAGE_NOTIFICATION=7 MESSAGE_NOTIFICATION value
 */
$root.HeadType = (function() {
    var valuesById = {}, values = Object.create(valuesById);
    values[valuesById[0] = "LOGIN_REQUEST"] = 0;
    values[valuesById[1] = "LOGIN_RESPONSE"] = 1;
    values[valuesById[2] = "LOGOUT_REQUEST"] = 2;
    values[valuesById[3] = "LOGOUT_RESPONSE"] = 3;
    values[valuesById[4] = "HEART_BEAT"] = 4;
    values[valuesById[5] = "MESSAGE_REQUEST"] = 5;
    values[valuesById[6] = "MESSAGE_RESPONSE"] = 6;
    values[valuesById[7] = "MESSAGE_NOTIFICATION"] = 7;
    return values;
})();

$root.LoginRequest = (function() {

    /**
     * Properties of a LoginRequest.
     * @exports ILoginRequest
     * @interface ILoginRequest
     * @property {string|null} [uid] LoginRequest uid
     * @property {string|null} [deviceId] LoginRequest deviceId
     * @property {string|null} [token] LoginRequest token
     * @property {number|null} [platform] LoginRequest platform
     * @property {string|null} [appVersion] LoginRequest appVersion
     */

    /**
     * Constructs a new LoginRequest.
     * @exports LoginRequest
     * @classdesc Represents a LoginRequest.
     * @implements ILoginRequest
     * @constructor
     * @param {ILoginRequest=} [properties] Properties to set
     */
    function LoginRequest(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * LoginRequest uid.
     * @member {string} uid
     * @memberof LoginRequest
     * @instance
     */
    LoginRequest.prototype.uid = "";

    /**
     * LoginRequest deviceId.
     * @member {string} deviceId
     * @memberof LoginRequest
     * @instance
     */
    LoginRequest.prototype.deviceId = "";

    /**
     * LoginRequest token.
     * @member {string} token
     * @memberof LoginRequest
     * @instance
     */
    LoginRequest.prototype.token = "";

    /**
     * LoginRequest platform.
     * @member {number} platform
     * @memberof LoginRequest
     * @instance
     */
    LoginRequest.prototype.platform = 0;

    /**
     * LoginRequest appVersion.
     * @member {string} appVersion
     * @memberof LoginRequest
     * @instance
     */
    LoginRequest.prototype.appVersion = "";

    /**
     * Creates a new LoginRequest instance using the specified properties.
     * @function create
     * @memberof LoginRequest
     * @static
     * @param {ILoginRequest=} [properties] Properties to set
     * @returns {LoginRequest} LoginRequest instance
     */
    LoginRequest.create = function create(properties) {
        return new LoginRequest(properties);
    };

    /**
     * Encodes the specified LoginRequest message. Does not implicitly {@link LoginRequest.verify|verify} messages.
     * @function encode
     * @memberof LoginRequest
     * @static
     * @param {ILoginRequest} message LoginRequest message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    LoginRequest.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.uid != null && Object.hasOwnProperty.call(message, "uid"))
            writer.uint32(/* id 1, wireType 2 =*/10).string(message.uid);
        if (message.deviceId != null && Object.hasOwnProperty.call(message, "deviceId"))
            writer.uint32(/* id 2, wireType 2 =*/18).string(message.deviceId);
        if (message.token != null && Object.hasOwnProperty.call(message, "token"))
            writer.uint32(/* id 3, wireType 2 =*/26).string(message.token);
        if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
            writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.platform);
        if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion"))
            writer.uint32(/* id 5, wireType 2 =*/42).string(message.appVersion);
        return writer;
    };

    /**
     * Encodes the specified LoginRequest message, length delimited. Does not implicitly {@link LoginRequest.verify|verify} messages.
     * @function encodeDelimited
     * @memberof LoginRequest
     * @static
     * @param {ILoginRequest} message LoginRequest message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    LoginRequest.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a LoginRequest message from the specified reader or buffer.
     * @function decode
     * @memberof LoginRequest
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {LoginRequest} LoginRequest
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    LoginRequest.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.LoginRequest();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.uid = reader.string();
                    break;
                }
            case 2: {
                    message.deviceId = reader.string();
                    break;
                }
            case 3: {
                    message.token = reader.string();
                    break;
                }
            case 4: {
                    message.platform = reader.uint32();
                    break;
                }
            case 5: {
                    message.appVersion = reader.string();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a LoginRequest message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof LoginRequest
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {LoginRequest} LoginRequest
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    LoginRequest.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a LoginRequest message.
     * @function verify
     * @memberof LoginRequest
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    LoginRequest.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.uid != null && message.hasOwnProperty("uid"))
            if (!$util.isString(message.uid))
                return "uid: string expected";
        if (message.deviceId != null && message.hasOwnProperty("deviceId"))
            if (!$util.isString(message.deviceId))
                return "deviceId: string expected";
        if (message.token != null && message.hasOwnProperty("token"))
            if (!$util.isString(message.token))
                return "token: string expected";
        if (message.platform != null && message.hasOwnProperty("platform"))
            if (!$util.isInteger(message.platform))
                return "platform: integer expected";
        if (message.appVersion != null && message.hasOwnProperty("appVersion"))
            if (!$util.isString(message.appVersion))
                return "appVersion: string expected";
        return null;
    };

    /**
     * Creates a LoginRequest message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof LoginRequest
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {LoginRequest} LoginRequest
     */
    LoginRequest.fromObject = function fromObject(object) {
        if (object instanceof $root.LoginRequest)
            return object;
        var message = new $root.LoginRequest();
        if (object.uid != null)
            message.uid = String(object.uid);
        if (object.deviceId != null)
            message.deviceId = String(object.deviceId);
        if (object.token != null)
            message.token = String(object.token);
        if (object.platform != null)
            message.platform = object.platform >>> 0;
        if (object.appVersion != null)
            message.appVersion = String(object.appVersion);
        return message;
    };

    /**
     * Creates a plain object from a LoginRequest message. Also converts values to other types if specified.
     * @function toObject
     * @memberof LoginRequest
     * @static
     * @param {LoginRequest} message LoginRequest
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    LoginRequest.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults) {
            object.uid = "";
            object.deviceId = "";
            object.token = "";
            object.platform = 0;
            object.appVersion = "";
        }
        if (message.uid != null && message.hasOwnProperty("uid"))
            object.uid = message.uid;
        if (message.deviceId != null && message.hasOwnProperty("deviceId"))
            object.deviceId = message.deviceId;
        if (message.token != null && message.hasOwnProperty("token"))
            object.token = message.token;
        if (message.platform != null && message.hasOwnProperty("platform"))
            object.platform = message.platform;
        if (message.appVersion != null && message.hasOwnProperty("appVersion"))
            object.appVersion = message.appVersion;
        return object;
    };

    /**
     * Converts this LoginRequest to JSON.
     * @function toJSON
     * @memberof LoginRequest
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    LoginRequest.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for LoginRequest
     * @function getTypeUrl
     * @memberof LoginRequest
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    LoginRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/LoginRequest";
    };

    return LoginRequest;
})();

$root.LoginResponse = (function() {

    /**
     * Properties of a LoginResponse.
     * @exports ILoginResponse
     * @interface ILoginResponse
     * @property {boolean|null} [result] LoginResponse result
     * @property {number|null} [code] LoginResponse code
     * @property {string|null} [info] LoginResponse info
     * @property {number|null} [expose] LoginResponse expose
     */

    /**
     * Constructs a new LoginResponse.
     * @exports LoginResponse
     * @classdesc Represents a LoginResponse.
     * @implements ILoginResponse
     * @constructor
     * @param {ILoginResponse=} [properties] Properties to set
     */
    function LoginResponse(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * LoginResponse result.
     * @member {boolean} result
     * @memberof LoginResponse
     * @instance
     */
    LoginResponse.prototype.result = false;

    /**
     * LoginResponse code.
     * @member {number} code
     * @memberof LoginResponse
     * @instance
     */
    LoginResponse.prototype.code = 0;

    /**
     * LoginResponse info.
     * @member {string} info
     * @memberof LoginResponse
     * @instance
     */
    LoginResponse.prototype.info = "";

    /**
     * LoginResponse expose.
     * @member {number} expose
     * @memberof LoginResponse
     * @instance
     */
    LoginResponse.prototype.expose = 0;

    /**
     * Creates a new LoginResponse instance using the specified properties.
     * @function create
     * @memberof LoginResponse
     * @static
     * @param {ILoginResponse=} [properties] Properties to set
     * @returns {LoginResponse} LoginResponse instance
     */
    LoginResponse.create = function create(properties) {
        return new LoginResponse(properties);
    };

    /**
     * Encodes the specified LoginResponse message. Does not implicitly {@link LoginResponse.verify|verify} messages.
     * @function encode
     * @memberof LoginResponse
     * @static
     * @param {ILoginResponse} message LoginResponse message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    LoginResponse.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.result != null && Object.hasOwnProperty.call(message, "result"))
            writer.uint32(/* id 1, wireType 0 =*/8).bool(message.result);
        if (message.code != null && Object.hasOwnProperty.call(message, "code"))
            writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.code);
        if (message.info != null && Object.hasOwnProperty.call(message, "info"))
            writer.uint32(/* id 3, wireType 2 =*/26).string(message.info);
        if (message.expose != null && Object.hasOwnProperty.call(message, "expose"))
            writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.expose);
        return writer;
    };

    /**
     * Encodes the specified LoginResponse message, length delimited. Does not implicitly {@link LoginResponse.verify|verify} messages.
     * @function encodeDelimited
     * @memberof LoginResponse
     * @static
     * @param {ILoginResponse} message LoginResponse message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    LoginResponse.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a LoginResponse message from the specified reader or buffer.
     * @function decode
     * @memberof LoginResponse
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {LoginResponse} LoginResponse
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    LoginResponse.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.LoginResponse();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.result = reader.bool();
                    break;
                }
            case 2: {
                    message.code = reader.uint32();
                    break;
                }
            case 3: {
                    message.info = reader.string();
                    break;
                }
            case 4: {
                    message.expose = reader.uint32();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a LoginResponse message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof LoginResponse
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {LoginResponse} LoginResponse
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    LoginResponse.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a LoginResponse message.
     * @function verify
     * @memberof LoginResponse
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    LoginResponse.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.result != null && message.hasOwnProperty("result"))
            if (typeof message.result !== "boolean")
                return "result: boolean expected";
        if (message.code != null && message.hasOwnProperty("code"))
            if (!$util.isInteger(message.code))
                return "code: integer expected";
        if (message.info != null && message.hasOwnProperty("info"))
            if (!$util.isString(message.info))
                return "info: string expected";
        if (message.expose != null && message.hasOwnProperty("expose"))
            if (!$util.isInteger(message.expose))
                return "expose: integer expected";
        return null;
    };

    /**
     * Creates a LoginResponse message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof LoginResponse
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {LoginResponse} LoginResponse
     */
    LoginResponse.fromObject = function fromObject(object) {
        if (object instanceof $root.LoginResponse)
            return object;
        var message = new $root.LoginResponse();
        if (object.result != null)
            message.result = Boolean(object.result);
        if (object.code != null)
            message.code = object.code >>> 0;
        if (object.info != null)
            message.info = String(object.info);
        if (object.expose != null)
            message.expose = object.expose >>> 0;
        return message;
    };

    /**
     * Creates a plain object from a LoginResponse message. Also converts values to other types if specified.
     * @function toObject
     * @memberof LoginResponse
     * @static
     * @param {LoginResponse} message LoginResponse
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    LoginResponse.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults) {
            object.result = false;
            object.code = 0;
            object.info = "";
            object.expose = 0;
        }
        if (message.result != null && message.hasOwnProperty("result"))
            object.result = message.result;
        if (message.code != null && message.hasOwnProperty("code"))
            object.code = message.code;
        if (message.info != null && message.hasOwnProperty("info"))
            object.info = message.info;
        if (message.expose != null && message.hasOwnProperty("expose"))
            object.expose = message.expose;
        return object;
    };

    /**
     * Converts this LoginResponse to JSON.
     * @function toJSON
     * @memberof LoginResponse
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    LoginResponse.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for LoginResponse
     * @function getTypeUrl
     * @memberof LoginResponse
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    LoginResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/LoginResponse";
    };

    return LoginResponse;
})();

$root.MessageRequest = (function() {

    /**
     * Properties of a MessageRequest.
     * @exports IMessageRequest
     * @interface IMessageRequest
     * @property {number|Long|null} [msgId] MessageRequest msgId
     * @property {string|null} [from] MessageRequest from
     * @property {string|null} [to] MessageRequest to
     * @property {number|Long|null} [time] MessageRequest time
     * @property {number|null} [msgType] MessageRequest msgType
     * @property {string|null} [content] MessageRequest content
     * @property {string|null} [url] MessageRequest url
     * @property {string|null} [property] MessageRequest property
     * @property {string|null} [fromNick] MessageRequest fromNick
     * @property {string|null} [json] MessageRequest json
     */

    /**
     * Constructs a new MessageRequest.
     * @exports MessageRequest
     * @classdesc Represents a MessageRequest.
     * @implements IMessageRequest
     * @constructor
     * @param {IMessageRequest=} [properties] Properties to set
     */
    function MessageRequest(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * MessageRequest msgId.
     * @member {number|Long} msgId
     * @memberof MessageRequest
     * @instance
     */
    MessageRequest.prototype.msgId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

    /**
     * MessageRequest from.
     * @member {string} from
     * @memberof MessageRequest
     * @instance
     */
    MessageRequest.prototype.from = "";

    /**
     * MessageRequest to.
     * @member {string} to
     * @memberof MessageRequest
     * @instance
     */
    MessageRequest.prototype.to = "";

    /**
     * MessageRequest time.
     * @member {number|Long} time
     * @memberof MessageRequest
     * @instance
     */
    MessageRequest.prototype.time = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

    /**
     * MessageRequest msgType.
     * @member {number} msgType
     * @memberof MessageRequest
     * @instance
     */
    MessageRequest.prototype.msgType = 0;

    /**
     * MessageRequest content.
     * @member {string} content
     * @memberof MessageRequest
     * @instance
     */
    MessageRequest.prototype.content = "";

    /**
     * MessageRequest url.
     * @member {string} url
     * @memberof MessageRequest
     * @instance
     */
    MessageRequest.prototype.url = "";

    /**
     * MessageRequest property.
     * @member {string} property
     * @memberof MessageRequest
     * @instance
     */
    MessageRequest.prototype.property = "";

    /**
     * MessageRequest fromNick.
     * @member {string} fromNick
     * @memberof MessageRequest
     * @instance
     */
    MessageRequest.prototype.fromNick = "";

    /**
     * MessageRequest json.
     * @member {string} json
     * @memberof MessageRequest
     * @instance
     */
    MessageRequest.prototype.json = "";

    /**
     * Creates a new MessageRequest instance using the specified properties.
     * @function create
     * @memberof MessageRequest
     * @static
     * @param {IMessageRequest=} [properties] Properties to set
     * @returns {MessageRequest} MessageRequest instance
     */
    MessageRequest.create = function create(properties) {
        return new MessageRequest(properties);
    };

    /**
     * Encodes the specified MessageRequest message. Does not implicitly {@link MessageRequest.verify|verify} messages.
     * @function encode
     * @memberof MessageRequest
     * @static
     * @param {IMessageRequest} message MessageRequest message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    MessageRequest.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.msgId != null && Object.hasOwnProperty.call(message, "msgId"))
            writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.msgId);
        if (message.from != null && Object.hasOwnProperty.call(message, "from"))
            writer.uint32(/* id 2, wireType 2 =*/18).string(message.from);
        if (message.to != null && Object.hasOwnProperty.call(message, "to"))
            writer.uint32(/* id 3, wireType 2 =*/26).string(message.to);
        if (message.time != null && Object.hasOwnProperty.call(message, "time"))
            writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.time);
        if (message.msgType != null && Object.hasOwnProperty.call(message, "msgType"))
            writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.msgType);
        if (message.content != null && Object.hasOwnProperty.call(message, "content"))
            writer.uint32(/* id 6, wireType 2 =*/50).string(message.content);
        if (message.url != null && Object.hasOwnProperty.call(message, "url"))
            writer.uint32(/* id 8, wireType 2 =*/66).string(message.url);
        if (message.property != null && Object.hasOwnProperty.call(message, "property"))
            writer.uint32(/* id 9, wireType 2 =*/74).string(message.property);
        if (message.fromNick != null && Object.hasOwnProperty.call(message, "fromNick"))
            writer.uint32(/* id 10, wireType 2 =*/82).string(message.fromNick);
        if (message.json != null && Object.hasOwnProperty.call(message, "json"))
            writer.uint32(/* id 11, wireType 2 =*/90).string(message.json);
        return writer;
    };

    /**
     * Encodes the specified MessageRequest message, length delimited. Does not implicitly {@link MessageRequest.verify|verify} messages.
     * @function encodeDelimited
     * @memberof MessageRequest
     * @static
     * @param {IMessageRequest} message MessageRequest message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    MessageRequest.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a MessageRequest message from the specified reader or buffer.
     * @function decode
     * @memberof MessageRequest
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {MessageRequest} MessageRequest
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    MessageRequest.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MessageRequest();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.msgId = reader.uint64();
                    break;
                }
            case 2: {
                    message.from = reader.string();
                    break;
                }
            case 3: {
                    message.to = reader.string();
                    break;
                }
            case 4: {
                    message.time = reader.uint64();
                    break;
                }
            case 5: {
                    message.msgType = reader.uint32();
                    break;
                }
            case 6: {
                    message.content = reader.string();
                    break;
                }
            case 8: {
                    message.url = reader.string();
                    break;
                }
            case 9: {
                    message.property = reader.string();
                    break;
                }
            case 10: {
                    message.fromNick = reader.string();
                    break;
                }
            case 11: {
                    message.json = reader.string();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a MessageRequest message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof MessageRequest
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {MessageRequest} MessageRequest
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    MessageRequest.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a MessageRequest message.
     * @function verify
     * @memberof MessageRequest
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    MessageRequest.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.msgId != null && message.hasOwnProperty("msgId"))
            if (!$util.isInteger(message.msgId) && !(message.msgId && $util.isInteger(message.msgId.low) && $util.isInteger(message.msgId.high)))
                return "msgId: integer|Long expected";
        if (message.from != null && message.hasOwnProperty("from"))
            if (!$util.isString(message.from))
                return "from: string expected";
        if (message.to != null && message.hasOwnProperty("to"))
            if (!$util.isString(message.to))
                return "to: string expected";
        if (message.time != null && message.hasOwnProperty("time"))
            if (!$util.isInteger(message.time) && !(message.time && $util.isInteger(message.time.low) && $util.isInteger(message.time.high)))
                return "time: integer|Long expected";
        if (message.msgType != null && message.hasOwnProperty("msgType"))
            if (!$util.isInteger(message.msgType))
                return "msgType: integer expected";
        if (message.content != null && message.hasOwnProperty("content"))
            if (!$util.isString(message.content))
                return "content: string expected";
        if (message.url != null && message.hasOwnProperty("url"))
            if (!$util.isString(message.url))
                return "url: string expected";
        if (message.property != null && message.hasOwnProperty("property"))
            if (!$util.isString(message.property))
                return "property: string expected";
        if (message.fromNick != null && message.hasOwnProperty("fromNick"))
            if (!$util.isString(message.fromNick))
                return "fromNick: string expected";
        if (message.json != null && message.hasOwnProperty("json"))
            if (!$util.isString(message.json))
                return "json: string expected";
        return null;
    };

    /**
     * Creates a MessageRequest message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof MessageRequest
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {MessageRequest} MessageRequest
     */
    MessageRequest.fromObject = function fromObject(object) {
        if (object instanceof $root.MessageRequest)
            return object;
        var message = new $root.MessageRequest();
        if (object.msgId != null)
            if ($util.Long)
                (message.msgId = $util.Long.fromValue(object.msgId)).unsigned = true;
            else if (typeof object.msgId === "string")
                message.msgId = parseInt(object.msgId, 10);
            else if (typeof object.msgId === "number")
                message.msgId = object.msgId;
            else if (typeof object.msgId === "object")
                message.msgId = new $util.LongBits(object.msgId.low >>> 0, object.msgId.high >>> 0).toNumber(true);
        if (object.from != null)
            message.from = String(object.from);
        if (object.to != null)
            message.to = String(object.to);
        if (object.time != null)
            if ($util.Long)
                (message.time = $util.Long.fromValue(object.time)).unsigned = true;
            else if (typeof object.time === "string")
                message.time = parseInt(object.time, 10);
            else if (typeof object.time === "number")
                message.time = object.time;
            else if (typeof object.time === "object")
                message.time = new $util.LongBits(object.time.low >>> 0, object.time.high >>> 0).toNumber(true);
        if (object.msgType != null)
            message.msgType = object.msgType >>> 0;
        if (object.content != null)
            message.content = String(object.content);
        if (object.url != null)
            message.url = String(object.url);
        if (object.property != null)
            message.property = String(object.property);
        if (object.fromNick != null)
            message.fromNick = String(object.fromNick);
        if (object.json != null)
            message.json = String(object.json);
        return message;
    };

    /**
     * Creates a plain object from a MessageRequest message. Also converts values to other types if specified.
     * @function toObject
     * @memberof MessageRequest
     * @static
     * @param {MessageRequest} message MessageRequest
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    MessageRequest.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults) {
            if ($util.Long) {
                var long = new $util.Long(0, 0, true);
                object.msgId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
            } else
                object.msgId = options.longs === String ? "0" : 0;
            object.from = "";
            object.to = "";
            if ($util.Long) {
                var long = new $util.Long(0, 0, true);
                object.time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
            } else
                object.time = options.longs === String ? "0" : 0;
            object.msgType = 0;
            object.content = "";
            object.url = "";
            object.property = "";
            object.fromNick = "";
            object.json = "";
        }
        if (message.msgId != null && message.hasOwnProperty("msgId"))
            if (typeof message.msgId === "number")
                object.msgId = options.longs === String ? String(message.msgId) : message.msgId;
            else
                object.msgId = options.longs === String ? $util.Long.prototype.toString.call(message.msgId) : options.longs === Number ? new $util.LongBits(message.msgId.low >>> 0, message.msgId.high >>> 0).toNumber(true) : message.msgId;
        if (message.from != null && message.hasOwnProperty("from"))
            object.from = message.from;
        if (message.to != null && message.hasOwnProperty("to"))
            object.to = message.to;
        if (message.time != null && message.hasOwnProperty("time"))
            if (typeof message.time === "number")
                object.time = options.longs === String ? String(message.time) : message.time;
            else
                object.time = options.longs === String ? $util.Long.prototype.toString.call(message.time) : options.longs === Number ? new $util.LongBits(message.time.low >>> 0, message.time.high >>> 0).toNumber(true) : message.time;
        if (message.msgType != null && message.hasOwnProperty("msgType"))
            object.msgType = message.msgType;
        if (message.content != null && message.hasOwnProperty("content"))
            object.content = message.content;
        if (message.url != null && message.hasOwnProperty("url"))
            object.url = message.url;
        if (message.property != null && message.hasOwnProperty("property"))
            object.property = message.property;
        if (message.fromNick != null && message.hasOwnProperty("fromNick"))
            object.fromNick = message.fromNick;
        if (message.json != null && message.hasOwnProperty("json"))
            object.json = message.json;
        return object;
    };

    /**
     * Converts this MessageRequest to JSON.
     * @function toJSON
     * @memberof MessageRequest
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    MessageRequest.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for MessageRequest
     * @function getTypeUrl
     * @memberof MessageRequest
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    MessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/MessageRequest";
    };

    return MessageRequest;
})();

$root.MessageResponse = (function() {

    /**
     * Properties of a MessageResponse.
     * @exports IMessageResponse
     * @interface IMessageResponse
     * @property {boolean|null} [result] MessageResponse result
     * @property {number|null} [code] MessageResponse code
     * @property {string|null} [info] MessageResponse info
     * @property {number|null} [expose] MessageResponse expose
     */

    /**
     * Constructs a new MessageResponse.
     * @exports MessageResponse
     * @classdesc Represents a MessageResponse.
     * @implements IMessageResponse
     * @constructor
     * @param {IMessageResponse=} [properties] Properties to set
     */
    function MessageResponse(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * MessageResponse result.
     * @member {boolean} result
     * @memberof MessageResponse
     * @instance
     */
    MessageResponse.prototype.result = false;

    /**
     * MessageResponse code.
     * @member {number} code
     * @memberof MessageResponse
     * @instance
     */
    MessageResponse.prototype.code = 0;

    /**
     * MessageResponse info.
     * @member {string} info
     * @memberof MessageResponse
     * @instance
     */
    MessageResponse.prototype.info = "";

    /**
     * MessageResponse expose.
     * @member {number} expose
     * @memberof MessageResponse
     * @instance
     */
    MessageResponse.prototype.expose = 0;

    /**
     * Creates a new MessageResponse instance using the specified properties.
     * @function create
     * @memberof MessageResponse
     * @static
     * @param {IMessageResponse=} [properties] Properties to set
     * @returns {MessageResponse} MessageResponse instance
     */
    MessageResponse.create = function create(properties) {
        return new MessageResponse(properties);
    };

    /**
     * Encodes the specified MessageResponse message. Does not implicitly {@link MessageResponse.verify|verify} messages.
     * @function encode
     * @memberof MessageResponse
     * @static
     * @param {IMessageResponse} message MessageResponse message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    MessageResponse.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.result != null && Object.hasOwnProperty.call(message, "result"))
            writer.uint32(/* id 1, wireType 0 =*/8).bool(message.result);
        if (message.code != null && Object.hasOwnProperty.call(message, "code"))
            writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.code);
        if (message.info != null && Object.hasOwnProperty.call(message, "info"))
            writer.uint32(/* id 3, wireType 2 =*/26).string(message.info);
        if (message.expose != null && Object.hasOwnProperty.call(message, "expose"))
            writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.expose);
        return writer;
    };

    /**
     * Encodes the specified MessageResponse message, length delimited. Does not implicitly {@link MessageResponse.verify|verify} messages.
     * @function encodeDelimited
     * @memberof MessageResponse
     * @static
     * @param {IMessageResponse} message MessageResponse message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    MessageResponse.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a MessageResponse message from the specified reader or buffer.
     * @function decode
     * @memberof MessageResponse
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {MessageResponse} MessageResponse
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    MessageResponse.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MessageResponse();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.result = reader.bool();
                    break;
                }
            case 2: {
                    message.code = reader.uint32();
                    break;
                }
            case 3: {
                    message.info = reader.string();
                    break;
                }
            case 4: {
                    message.expose = reader.uint32();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a MessageResponse message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof MessageResponse
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {MessageResponse} MessageResponse
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    MessageResponse.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a MessageResponse message.
     * @function verify
     * @memberof MessageResponse
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    MessageResponse.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.result != null && message.hasOwnProperty("result"))
            if (typeof message.result !== "boolean")
                return "result: boolean expected";
        if (message.code != null && message.hasOwnProperty("code"))
            if (!$util.isInteger(message.code))
                return "code: integer expected";
        if (message.info != null && message.hasOwnProperty("info"))
            if (!$util.isString(message.info))
                return "info: string expected";
        if (message.expose != null && message.hasOwnProperty("expose"))
            if (!$util.isInteger(message.expose))
                return "expose: integer expected";
        return null;
    };

    /**
     * Creates a MessageResponse message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof MessageResponse
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {MessageResponse} MessageResponse
     */
    MessageResponse.fromObject = function fromObject(object) {
        if (object instanceof $root.MessageResponse)
            return object;
        var message = new $root.MessageResponse();
        if (object.result != null)
            message.result = Boolean(object.result);
        if (object.code != null)
            message.code = object.code >>> 0;
        if (object.info != null)
            message.info = String(object.info);
        if (object.expose != null)
            message.expose = object.expose >>> 0;
        return message;
    };

    /**
     * Creates a plain object from a MessageResponse message. Also converts values to other types if specified.
     * @function toObject
     * @memberof MessageResponse
     * @static
     * @param {MessageResponse} message MessageResponse
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    MessageResponse.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults) {
            object.result = false;
            object.code = 0;
            object.info = "";
            object.expose = 0;
        }
        if (message.result != null && message.hasOwnProperty("result"))
            object.result = message.result;
        if (message.code != null && message.hasOwnProperty("code"))
            object.code = message.code;
        if (message.info != null && message.hasOwnProperty("info"))
            object.info = message.info;
        if (message.expose != null && message.hasOwnProperty("expose"))
            object.expose = message.expose;
        return object;
    };

    /**
     * Converts this MessageResponse to JSON.
     * @function toJSON
     * @memberof MessageResponse
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    MessageResponse.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for MessageResponse
     * @function getTypeUrl
     * @memberof MessageResponse
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    MessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/MessageResponse";
    };

    return MessageResponse;
})();

$root.MessageNotification = (function() {

    /**
     * Properties of a MessageNotification.
     * @exports IMessageNotification
     * @interface IMessageNotification
     * @property {number|Long|null} [noId] MessageNotification noId
     * @property {string|null} [json] MessageNotification json
     * @property {string|null} [timestamp] MessageNotification timestamp
     */

    /**
     * Constructs a new MessageNotification.
     * @exports MessageNotification
     * @classdesc Represents a MessageNotification.
     * @implements IMessageNotification
     * @constructor
     * @param {IMessageNotification=} [properties] Properties to set
     */
    function MessageNotification(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * MessageNotification noId.
     * @member {number|Long} noId
     * @memberof MessageNotification
     * @instance
     */
    MessageNotification.prototype.noId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

    /**
     * MessageNotification json.
     * @member {string} json
     * @memberof MessageNotification
     * @instance
     */
    MessageNotification.prototype.json = "";

    /**
     * MessageNotification timestamp.
     * @member {string} timestamp
     * @memberof MessageNotification
     * @instance
     */
    MessageNotification.prototype.timestamp = "";

    /**
     * Creates a new MessageNotification instance using the specified properties.
     * @function create
     * @memberof MessageNotification
     * @static
     * @param {IMessageNotification=} [properties] Properties to set
     * @returns {MessageNotification} MessageNotification instance
     */
    MessageNotification.create = function create(properties) {
        return new MessageNotification(properties);
    };

    /**
     * Encodes the specified MessageNotification message. Does not implicitly {@link MessageNotification.verify|verify} messages.
     * @function encode
     * @memberof MessageNotification
     * @static
     * @param {IMessageNotification} message MessageNotification message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    MessageNotification.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.noId != null && Object.hasOwnProperty.call(message, "noId"))
            writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.noId);
        if (message.json != null && Object.hasOwnProperty.call(message, "json"))
            writer.uint32(/* id 2, wireType 2 =*/18).string(message.json);
        if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
            writer.uint32(/* id 3, wireType 2 =*/26).string(message.timestamp);
        return writer;
    };

    /**
     * Encodes the specified MessageNotification message, length delimited. Does not implicitly {@link MessageNotification.verify|verify} messages.
     * @function encodeDelimited
     * @memberof MessageNotification
     * @static
     * @param {IMessageNotification} message MessageNotification message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    MessageNotification.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a MessageNotification message from the specified reader or buffer.
     * @function decode
     * @memberof MessageNotification
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {MessageNotification} MessageNotification
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    MessageNotification.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MessageNotification();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.noId = reader.uint64();
                    break;
                }
            case 2: {
                    message.json = reader.string();
                    break;
                }
            case 3: {
                    message.timestamp = reader.string();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a MessageNotification message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof MessageNotification
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {MessageNotification} MessageNotification
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    MessageNotification.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a MessageNotification message.
     * @function verify
     * @memberof MessageNotification
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    MessageNotification.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.noId != null && message.hasOwnProperty("noId"))
            if (!$util.isInteger(message.noId) && !(message.noId && $util.isInteger(message.noId.low) && $util.isInteger(message.noId.high)))
                return "noId: integer|Long expected";
        if (message.json != null && message.hasOwnProperty("json"))
            if (!$util.isString(message.json))
                return "json: string expected";
        if (message.timestamp != null && message.hasOwnProperty("timestamp"))
            if (!$util.isString(message.timestamp))
                return "timestamp: string expected";
        return null;
    };

    /**
     * Creates a MessageNotification message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof MessageNotification
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {MessageNotification} MessageNotification
     */
    MessageNotification.fromObject = function fromObject(object) {
        if (object instanceof $root.MessageNotification)
            return object;
        var message = new $root.MessageNotification();
        if (object.noId != null)
            if ($util.Long)
                (message.noId = $util.Long.fromValue(object.noId)).unsigned = true;
            else if (typeof object.noId === "string")
                message.noId = parseInt(object.noId, 10);
            else if (typeof object.noId === "number")
                message.noId = object.noId;
            else if (typeof object.noId === "object")
                message.noId = new $util.LongBits(object.noId.low >>> 0, object.noId.high >>> 0).toNumber(true);
        if (object.json != null)
            message.json = String(object.json);
        if (object.timestamp != null)
            message.timestamp = String(object.timestamp);
        return message;
    };

    /**
     * Creates a plain object from a MessageNotification message. Also converts values to other types if specified.
     * @function toObject
     * @memberof MessageNotification
     * @static
     * @param {MessageNotification} message MessageNotification
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    MessageNotification.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults) {
            if ($util.Long) {
                var long = new $util.Long(0, 0, true);
                object.noId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
            } else
                object.noId = options.longs === String ? "0" : 0;
            object.json = "";
            object.timestamp = "";
        }
        if (message.noId != null && message.hasOwnProperty("noId"))
            if (typeof message.noId === "number")
                object.noId = options.longs === String ? String(message.noId) : message.noId;
            else
                object.noId = options.longs === String ? $util.Long.prototype.toString.call(message.noId) : options.longs === Number ? new $util.LongBits(message.noId.low >>> 0, message.noId.high >>> 0).toNumber(true) : message.noId;
        if (message.json != null && message.hasOwnProperty("json"))
            object.json = message.json;
        if (message.timestamp != null && message.hasOwnProperty("timestamp"))
            object.timestamp = message.timestamp;
        return object;
    };

    /**
     * Converts this MessageNotification to JSON.
     * @function toJSON
     * @memberof MessageNotification
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    MessageNotification.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for MessageNotification
     * @function getTypeUrl
     * @memberof MessageNotification
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    MessageNotification.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/MessageNotification";
    };

    return MessageNotification;
})();

$root.MessageHeartBeat = (function() {

    /**
     * Properties of a MessageHeartBeat.
     * @exports IMessageHeartBeat
     * @interface IMessageHeartBeat
     * @property {number|null} [seq] MessageHeartBeat seq
     * @property {string|null} [uid] MessageHeartBeat uid
     * @property {string|null} [json] MessageHeartBeat json
     */

    /**
     * Constructs a new MessageHeartBeat.
     * @exports MessageHeartBeat
     * @classdesc Represents a MessageHeartBeat.
     * @implements IMessageHeartBeat
     * @constructor
     * @param {IMessageHeartBeat=} [properties] Properties to set
     */
    function MessageHeartBeat(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * MessageHeartBeat seq.
     * @member {number} seq
     * @memberof MessageHeartBeat
     * @instance
     */
    MessageHeartBeat.prototype.seq = 0;

    /**
     * MessageHeartBeat uid.
     * @member {string} uid
     * @memberof MessageHeartBeat
     * @instance
     */
    MessageHeartBeat.prototype.uid = "";

    /**
     * MessageHeartBeat json.
     * @member {string} json
     * @memberof MessageHeartBeat
     * @instance
     */
    MessageHeartBeat.prototype.json = "";

    /**
     * Creates a new MessageHeartBeat instance using the specified properties.
     * @function create
     * @memberof MessageHeartBeat
     * @static
     * @param {IMessageHeartBeat=} [properties] Properties to set
     * @returns {MessageHeartBeat} MessageHeartBeat instance
     */
    MessageHeartBeat.create = function create(properties) {
        return new MessageHeartBeat(properties);
    };

    /**
     * Encodes the specified MessageHeartBeat message. Does not implicitly {@link MessageHeartBeat.verify|verify} messages.
     * @function encode
     * @memberof MessageHeartBeat
     * @static
     * @param {IMessageHeartBeat} message MessageHeartBeat message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    MessageHeartBeat.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.seq != null && Object.hasOwnProperty.call(message, "seq"))
            writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.seq);
        if (message.uid != null && Object.hasOwnProperty.call(message, "uid"))
            writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid);
        if (message.json != null && Object.hasOwnProperty.call(message, "json"))
            writer.uint32(/* id 3, wireType 2 =*/26).string(message.json);
        return writer;
    };

    /**
     * Encodes the specified MessageHeartBeat message, length delimited. Does not implicitly {@link MessageHeartBeat.verify|verify} messages.
     * @function encodeDelimited
     * @memberof MessageHeartBeat
     * @static
     * @param {IMessageHeartBeat} message MessageHeartBeat message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    MessageHeartBeat.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a MessageHeartBeat message from the specified reader or buffer.
     * @function decode
     * @memberof MessageHeartBeat
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {MessageHeartBeat} MessageHeartBeat
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    MessageHeartBeat.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MessageHeartBeat();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.seq = reader.uint32();
                    break;
                }
            case 2: {
                    message.uid = reader.string();
                    break;
                }
            case 3: {
                    message.json = reader.string();
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a MessageHeartBeat message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof MessageHeartBeat
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {MessageHeartBeat} MessageHeartBeat
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    MessageHeartBeat.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a MessageHeartBeat message.
     * @function verify
     * @memberof MessageHeartBeat
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    MessageHeartBeat.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.seq != null && message.hasOwnProperty("seq"))
            if (!$util.isInteger(message.seq))
                return "seq: integer expected";
        if (message.uid != null && message.hasOwnProperty("uid"))
            if (!$util.isString(message.uid))
                return "uid: string expected";
        if (message.json != null && message.hasOwnProperty("json"))
            if (!$util.isString(message.json))
                return "json: string expected";
        return null;
    };

    /**
     * Creates a MessageHeartBeat message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof MessageHeartBeat
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {MessageHeartBeat} MessageHeartBeat
     */
    MessageHeartBeat.fromObject = function fromObject(object) {
        if (object instanceof $root.MessageHeartBeat)
            return object;
        var message = new $root.MessageHeartBeat();
        if (object.seq != null)
            message.seq = object.seq >>> 0;
        if (object.uid != null)
            message.uid = String(object.uid);
        if (object.json != null)
            message.json = String(object.json);
        return message;
    };

    /**
     * Creates a plain object from a MessageHeartBeat message. Also converts values to other types if specified.
     * @function toObject
     * @memberof MessageHeartBeat
     * @static
     * @param {MessageHeartBeat} message MessageHeartBeat
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    MessageHeartBeat.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults) {
            object.seq = 0;
            object.uid = "";
            object.json = "";
        }
        if (message.seq != null && message.hasOwnProperty("seq"))
            object.seq = message.seq;
        if (message.uid != null && message.hasOwnProperty("uid"))
            object.uid = message.uid;
        if (message.json != null && message.hasOwnProperty("json"))
            object.json = message.json;
        return object;
    };

    /**
     * Converts this MessageHeartBeat to JSON.
     * @function toJSON
     * @memberof MessageHeartBeat
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    MessageHeartBeat.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for MessageHeartBeat
     * @function getTypeUrl
     * @memberof MessageHeartBeat
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    MessageHeartBeat.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/MessageHeartBeat";
    };

    return MessageHeartBeat;
})();

$root.Message = (function() {

    /**
     * Properties of a Message.
     * @exports IMessage
     * @interface IMessage
     * @property {HeadType|null} [type] Message type
     * @property {number|Long|null} [sequence] Message sequence
     * @property {string|null} [sessionId] Message sessionId
     * @property {ILoginRequest|null} [loginRequest] Message loginRequest
     * @property {ILoginResponse|null} [loginResponse] Message loginResponse
     * @property {IMessageRequest|null} [messageRequest] Message messageRequest
     * @property {IMessageResponse|null} [messageResponse] Message messageResponse
     * @property {IMessageNotification|null} [notification] Message notification
     * @property {IMessageHeartBeat|null} [heartBeat] Message heartBeat
     */

    /**
     * Constructs a new Message.
     * @exports Message
     * @classdesc Represents a Message.
     * @implements IMessage
     * @constructor
     * @param {IMessage=} [properties] Properties to set
     */
    function Message(properties) {
        if (properties)
            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                if (properties[keys[i]] != null)
                    this[keys[i]] = properties[keys[i]];
    }

    /**
     * Message type.
     * @member {HeadType} type
     * @memberof Message
     * @instance
     */
    Message.prototype.type = 0;

    /**
     * Message sequence.
     * @member {number|Long} sequence
     * @memberof Message
     * @instance
     */
    Message.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

    /**
     * Message sessionId.
     * @member {string} sessionId
     * @memberof Message
     * @instance
     */
    Message.prototype.sessionId = "";

    /**
     * Message loginRequest.
     * @member {ILoginRequest|null|undefined} loginRequest
     * @memberof Message
     * @instance
     */
    Message.prototype.loginRequest = null;

    /**
     * Message loginResponse.
     * @member {ILoginResponse|null|undefined} loginResponse
     * @memberof Message
     * @instance
     */
    Message.prototype.loginResponse = null;

    /**
     * Message messageRequest.
     * @member {IMessageRequest|null|undefined} messageRequest
     * @memberof Message
     * @instance
     */
    Message.prototype.messageRequest = null;

    /**
     * Message messageResponse.
     * @member {IMessageResponse|null|undefined} messageResponse
     * @memberof Message
     * @instance
     */
    Message.prototype.messageResponse = null;

    /**
     * Message notification.
     * @member {IMessageNotification|null|undefined} notification
     * @memberof Message
     * @instance
     */
    Message.prototype.notification = null;

    /**
     * Message heartBeat.
     * @member {IMessageHeartBeat|null|undefined} heartBeat
     * @memberof Message
     * @instance
     */
    Message.prototype.heartBeat = null;

    /**
     * Creates a new Message instance using the specified properties.
     * @function create
     * @memberof Message
     * @static
     * @param {IMessage=} [properties] Properties to set
     * @returns {Message} Message instance
     */
    Message.create = function create(properties) {
        return new Message(properties);
    };

    /**
     * Encodes the specified Message message. Does not implicitly {@link Message.verify|verify} messages.
     * @function encode
     * @memberof Message
     * @static
     * @param {IMessage} message Message message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    Message.encode = function encode(message, writer) {
        if (!writer)
            writer = $Writer.create();
        if (message.type != null && Object.hasOwnProperty.call(message, "type"))
            writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);
        if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence"))
            writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.sequence);
        if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId"))
            writer.uint32(/* id 3, wireType 2 =*/26).string(message.sessionId);
        if (message.loginRequest != null && Object.hasOwnProperty.call(message, "loginRequest"))
            $root.LoginRequest.encode(message.loginRequest, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
        if (message.loginResponse != null && Object.hasOwnProperty.call(message, "loginResponse"))
            $root.LoginResponse.encode(message.loginResponse, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
        if (message.messageRequest != null && Object.hasOwnProperty.call(message, "messageRequest"))
            $root.MessageRequest.encode(message.messageRequest, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
        if (message.messageResponse != null && Object.hasOwnProperty.call(message, "messageResponse"))
            $root.MessageResponse.encode(message.messageResponse, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
        if (message.notification != null && Object.hasOwnProperty.call(message, "notification"))
            $root.MessageNotification.encode(message.notification, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
        if (message.heartBeat != null && Object.hasOwnProperty.call(message, "heartBeat"))
            $root.MessageHeartBeat.encode(message.heartBeat, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
        return writer;
    };

    /**
     * Encodes the specified Message message, length delimited. Does not implicitly {@link Message.verify|verify} messages.
     * @function encodeDelimited
     * @memberof Message
     * @static
     * @param {IMessage} message Message message or plain object to encode
     * @param {$protobuf.Writer} [writer] Writer to encode to
     * @returns {$protobuf.Writer} Writer
     */
    Message.encodeDelimited = function encodeDelimited(message, writer) {
        return this.encode(message, writer).ldelim();
    };

    /**
     * Decodes a Message message from the specified reader or buffer.
     * @function decode
     * @memberof Message
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @param {number} [length] Message length if known beforehand
     * @returns {Message} Message
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    Message.decode = function decode(reader, length) {
        if (!(reader instanceof $Reader))
            reader = $Reader.create(reader);
        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Message();
        while (reader.pos < end) {
            var tag = reader.uint32();
            switch (tag >>> 3) {
            case 1: {
                    message.type = reader.int32();
                    break;
                }
            case 2: {
                    message.sequence = reader.uint64();
                    break;
                }
            case 3: {
                    message.sessionId = reader.string();
                    break;
                }
            case 4: {
                    message.loginRequest = $root.LoginRequest.decode(reader, reader.uint32());
                    break;
                }
            case 5: {
                    message.loginResponse = $root.LoginResponse.decode(reader, reader.uint32());
                    break;
                }
            case 6: {
                    message.messageRequest = $root.MessageRequest.decode(reader, reader.uint32());
                    break;
                }
            case 7: {
                    message.messageResponse = $root.MessageResponse.decode(reader, reader.uint32());
                    break;
                }
            case 8: {
                    message.notification = $root.MessageNotification.decode(reader, reader.uint32());
                    break;
                }
            case 9: {
                    message.heartBeat = $root.MessageHeartBeat.decode(reader, reader.uint32());
                    break;
                }
            default:
                reader.skipType(tag & 7);
                break;
            }
        }
        return message;
    };

    /**
     * Decodes a Message message from the specified reader or buffer, length delimited.
     * @function decodeDelimited
     * @memberof Message
     * @static
     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
     * @returns {Message} Message
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    Message.decodeDelimited = function decodeDelimited(reader) {
        if (!(reader instanceof $Reader))
            reader = new $Reader(reader);
        return this.decode(reader, reader.uint32());
    };

    /**
     * Verifies a Message message.
     * @function verify
     * @memberof Message
     * @static
     * @param {Object.<string,*>} message Plain object to verify
     * @returns {string|null} `null` if valid, otherwise the reason why it is not
     */
    Message.verify = function verify(message) {
        if (typeof message !== "object" || message === null)
            return "object expected";
        if (message.type != null && message.hasOwnProperty("type"))
            switch (message.type) {
            default:
                return "type: enum value expected";
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
                break;
            }
        if (message.sequence != null && message.hasOwnProperty("sequence"))
            if (!$util.isInteger(message.sequence) && !(message.sequence && $util.isInteger(message.sequence.low) && $util.isInteger(message.sequence.high)))
                return "sequence: integer|Long expected";
        if (message.sessionId != null && message.hasOwnProperty("sessionId"))
            if (!$util.isString(message.sessionId))
                return "sessionId: string expected";
        if (message.loginRequest != null && message.hasOwnProperty("loginRequest")) {
            var error = $root.LoginRequest.verify(message.loginRequest);
            if (error)
                return "loginRequest." + error;
        }
        if (message.loginResponse != null && message.hasOwnProperty("loginResponse")) {
            var error = $root.LoginResponse.verify(message.loginResponse);
            if (error)
                return "loginResponse." + error;
        }
        if (message.messageRequest != null && message.hasOwnProperty("messageRequest")) {
            var error = $root.MessageRequest.verify(message.messageRequest);
            if (error)
                return "messageRequest." + error;
        }
        if (message.messageResponse != null && message.hasOwnProperty("messageResponse")) {
            var error = $root.MessageResponse.verify(message.messageResponse);
            if (error)
                return "messageResponse." + error;
        }
        if (message.notification != null && message.hasOwnProperty("notification")) {
            var error = $root.MessageNotification.verify(message.notification);
            if (error)
                return "notification." + error;
        }
        if (message.heartBeat != null && message.hasOwnProperty("heartBeat")) {
            var error = $root.MessageHeartBeat.verify(message.heartBeat);
            if (error)
                return "heartBeat." + error;
        }
        return null;
    };

    /**
     * Creates a Message message from a plain object. Also converts values to their respective internal types.
     * @function fromObject
     * @memberof Message
     * @static
     * @param {Object.<string,*>} object Plain object
     * @returns {Message} Message
     */
    Message.fromObject = function fromObject(object) {
        if (object instanceof $root.Message)
            return object;
        var message = new $root.Message();
        switch (object.type) {
        default:
            if (typeof object.type === "number") {
                message.type = object.type;
                break;
            }
            break;
        case "LOGIN_REQUEST":
        case 0:
            message.type = 0;
            break;
        case "LOGIN_RESPONSE":
        case 1:
            message.type = 1;
            break;
        case "LOGOUT_REQUEST":
        case 2:
            message.type = 2;
            break;
        case "LOGOUT_RESPONSE":
        case 3:
            message.type = 3;
            break;
        case "HEART_BEAT":
        case 4:
            message.type = 4;
            break;
        case "MESSAGE_REQUEST":
        case 5:
            message.type = 5;
            break;
        case "MESSAGE_RESPONSE":
        case 6:
            message.type = 6;
            break;
        case "MESSAGE_NOTIFICATION":
        case 7:
            message.type = 7;
            break;
        }
        if (object.sequence != null)
            if ($util.Long)
                (message.sequence = $util.Long.fromValue(object.sequence)).unsigned = true;
            else if (typeof object.sequence === "string")
                message.sequence = parseInt(object.sequence, 10);
            else if (typeof object.sequence === "number")
                message.sequence = object.sequence;
            else if (typeof object.sequence === "object")
                message.sequence = new $util.LongBits(object.sequence.low >>> 0, object.sequence.high >>> 0).toNumber(true);
        if (object.sessionId != null)
            message.sessionId = String(object.sessionId);
        if (object.loginRequest != null) {
            if (typeof object.loginRequest !== "object")
                throw TypeError(".Message.loginRequest: object expected");
            message.loginRequest = $root.LoginRequest.fromObject(object.loginRequest);
        }
        if (object.loginResponse != null) {
            if (typeof object.loginResponse !== "object")
                throw TypeError(".Message.loginResponse: object expected");
            message.loginResponse = $root.LoginResponse.fromObject(object.loginResponse);
        }
        if (object.messageRequest != null) {
            if (typeof object.messageRequest !== "object")
                throw TypeError(".Message.messageRequest: object expected");
            message.messageRequest = $root.MessageRequest.fromObject(object.messageRequest);
        }
        if (object.messageResponse != null) {
            if (typeof object.messageResponse !== "object")
                throw TypeError(".Message.messageResponse: object expected");
            message.messageResponse = $root.MessageResponse.fromObject(object.messageResponse);
        }
        if (object.notification != null) {
            if (typeof object.notification !== "object")
                throw TypeError(".Message.notification: object expected");
            message.notification = $root.MessageNotification.fromObject(object.notification);
        }
        if (object.heartBeat != null) {
            if (typeof object.heartBeat !== "object")
                throw TypeError(".Message.heartBeat: object expected");
            message.heartBeat = $root.MessageHeartBeat.fromObject(object.heartBeat);
        }
        return message;
    };

    /**
     * Creates a plain object from a Message message. Also converts values to other types if specified.
     * @function toObject
     * @memberof Message
     * @static
     * @param {Message} message Message
     * @param {$protobuf.IConversionOptions} [options] Conversion options
     * @returns {Object.<string,*>} Plain object
     */
    Message.toObject = function toObject(message, options) {
        if (!options)
            options = {};
        var object = {};
        if (options.defaults) {
            object.type = options.enums === String ? "LOGIN_REQUEST" : 0;
            if ($util.Long) {
                var long = new $util.Long(0, 0, true);
                object.sequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
            } else
                object.sequence = options.longs === String ? "0" : 0;
            object.sessionId = "";
            object.loginRequest = null;
            object.loginResponse = null;
            object.messageRequest = null;
            object.messageResponse = null;
            object.notification = null;
            object.heartBeat = null;
        }
        if (message.type != null && message.hasOwnProperty("type"))
            object.type = options.enums === String ? $root.HeadType[message.type] === undefined ? message.type : $root.HeadType[message.type] : message.type;
        if (message.sequence != null && message.hasOwnProperty("sequence"))
            if (typeof message.sequence === "number")
                object.sequence = options.longs === String ? String(message.sequence) : message.sequence;
            else
                object.sequence = options.longs === String ? $util.Long.prototype.toString.call(message.sequence) : options.longs === Number ? new $util.LongBits(message.sequence.low >>> 0, message.sequence.high >>> 0).toNumber(true) : message.sequence;
        if (message.sessionId != null && message.hasOwnProperty("sessionId"))
            object.sessionId = message.sessionId;
        if (message.loginRequest != null && message.hasOwnProperty("loginRequest"))
            object.loginRequest = $root.LoginRequest.toObject(message.loginRequest, options);
        if (message.loginResponse != null && message.hasOwnProperty("loginResponse"))
            object.loginResponse = $root.LoginResponse.toObject(message.loginResponse, options);
        if (message.messageRequest != null && message.hasOwnProperty("messageRequest"))
            object.messageRequest = $root.MessageRequest.toObject(message.messageRequest, options);
        if (message.messageResponse != null && message.hasOwnProperty("messageResponse"))
            object.messageResponse = $root.MessageResponse.toObject(message.messageResponse, options);
        if (message.notification != null && message.hasOwnProperty("notification"))
            object.notification = $root.MessageNotification.toObject(message.notification, options);
        if (message.heartBeat != null && message.hasOwnProperty("heartBeat"))
            object.heartBeat = $root.MessageHeartBeat.toObject(message.heartBeat, options);
        return object;
    };

    /**
     * Converts this Message to JSON.
     * @function toJSON
     * @memberof Message
     * @instance
     * @returns {Object.<string,*>} JSON object
     */
    Message.prototype.toJSON = function toJSON() {
        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
    };

    /**
     * Gets the default type url for Message
     * @function getTypeUrl
     * @memberof Message
     * @static
     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns {string} The default type url
     */
    Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
        if (typeUrlPrefix === undefined) {
            typeUrlPrefix = "type.googleapis.com";
        }
        return typeUrlPrefix + "/Message";
    };

    return Message;
})();

module.exports = $root;
